package com.pl.controller;

import com.pl.common.JsonResult;
import com.pl.domain.User;
import com.pl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shent
 */
@RestController
@RequestMapping("sql")
public class TestSqlController {
    @Autowired
    UserService userService;

    @GetMapping("getUser")
    public JsonResult<User> getUserByUsername(@RequestParam(value = "username") String username) {
        return new JsonResult<>(userService.getUserByUsername(username));
    }

}
